package com.pay.download;

import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

import com.pay.entity.ZfbMember;

/**
 * fundAccountDetail下载器
 * @author Administrator
 *
 */
public class StandardDownload {

	public static String download(ZfbMember zfbMember) throws Exception {
		CloseableHttpClient httpClient=HttpClients.createDefault(); // 创建httpClient实例
		HttpGet httpget = new HttpGet("https://consumeprod.alipay.com/record/standard.htm"); // 创建httpget实例
		httpget.addHeader("Cookie", zfbMember.getCookie());
		httpget.addHeader("Upgrade-Insecure-Requests","1");
		httpget.addHeader("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 QQBrowser/4.4.116.400 Version/5.1.1 Safari/534.51.22");
		CloseableHttpResponse response = httpClient.execute(httpget);
		HttpEntity entity=response.getEntity(); // 获取返回实体
		String result = EntityUtils.toString(entity, "utf-8");
		response.close(); 
		httpClient.close();
		return result ;
	}
}
